(function() { var l=void 0,m=!0,q=null,D=!1; (function(){function Aa(){function a(){if(!a.sc)la=a.sc=m,ma=D,c.a(F,function(a){a.gc()})}function b(){try{u.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}if(u.addEventListener)"complete"===u.readyState?a():u.addEventListener("DOMContentLoaded",a,D);else if(u.attachEvent){u.attachEvent("onreadystatechange",a);var d=D;try{d=x.frameElement===q}catch(f){}u.documentElement.doScroll&&d&&b()}c.Ib(x,"load",a,m)}function Ba(){y.init=function(a,b,d){if(d)return y[d]||(y[d]=F[d]=S(a, b,d),y[d].ea()),y[d];d=y;if(F.mixpanel)d=F.mixpanel;else if(a)d=S(a,b,"mixpanel"),d.ea(),F.mixpanel=d;y=d;1===ca&&(x.mixpanel=y);Ca()}}function Ca(){c.a(F,function(a,b){"mixpanel"!==b&&(y[b]=a)});y._=c}function da(a){a=c.e(a)?a:c.g(a)?{}:{days:a};return c.extend({},Da,a)}function S(a,b,d){var f,h="mixpanel"===d?y:y[d];if(h&&0===ca)f=h;else{if(h&&!c.isArray(h)){p.error("You have already initialized "+d);return}f=new e}f.$a={};f.T(a,b,d);f.people=new j;f.people.T(f);if(!f.c("skip_first_touch_marketing")){var a= c.info.ha(q),g={},s=D;c.a(a,function(a,b){(g["initial_"+b]=a)&&(s=m)});s&&f.people.Z(g)}J=J||f.c("debug");!c.g(h)&&c.isArray(h)&&(f.wa.call(f.people,h.people),f.wa(h));return f}function e(){}function P(){}function Ea(a){return a}function n(a){this.props={};this.qd=D;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)p.H("Unknown persistence type "+b+"; falling back to cookie"),b=a.persistence="cookie";this.i="localStorage"=== b&&c.localStorage.oa()?c.localStorage:c.cookie;this.load();this.bc(a);this.md(a);this.save()}function j(){}function t(){}function C(a,b){this.I=b.I;this.W=new G(a,{I:c.bind(this.h,this),i:b.i});this.A=b.A;this.Qc=b.Rc;this.fa=b.fa;this.$c=b.ad;this.C=this.A.batch_size;this.la=this.A.batch_flush_interval_ms;this.qa=!this.A.batch_autostart;this.Ga=0;this.F={}}function na(a,b){var d=[];c.a(a,function(a){var c=a.id;if(c in b){if(c=b[c],c!==q)a.payload=c,d.push(a)}else d.push(a)});return d}function oa(a, b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function G(a,b){b=b||{};this.K=a;this.i=b.i||window.localStorage;this.h=b.I||c.bind(pa.error,pa);this.Ra=new qa(a,{i:this.i});this.pa=b.pa||q;this.G=[]}function qa(a,b){b=b||{};this.K=a;this.i=b.i||window.localStorage;this.Gb=b.Gb||100;this.Vb=b.Vb||2E3}function T(){this.Db="submit"}function L(){this.Db="click"}function E(){}function ra(a){var b=Fa,d=a.split("."),d=d[d.length-1];if(4a?"0"+a:a}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+"T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())};c.ra=function(a){var b={};c.a(a,function(a,f){c.Qa(a)&&0=i;)h()}function d(){var a,b,d="",c;if('"'=== i)for(;h();){if('"'===i)return h(),d;if("\\"===i)if(h(),"u"===i){for(b=c=0;4>b;b+=1){a=parseInt(h(),16);if(!isFinite(a))break;c=16*c+a}d+=String.fromCharCode(c)}else if("string"===typeof e[i])d+=e[i];else break;else d+=i}g("Bad string")}function c(){var a;a="";"-"===i&&(a="-",h("-"));for(;"0"<=i&&"9">=i;)a+=i,h();if("."===i)for(a+=".";h()&&"0"<=i&&"9">=i;)a+=i;if("e"===i||"E"===i){a+=i;h();if("-"===i||"+"===i)a+=i,h();for(;"0"<=i&&"9">=i;)a+=i,h()}a=+a;if(isFinite(a))return a;g("Bad number")}function h(a){a&& a!==i&&g("Expected '"+a+"' instead of '"+i+"'");i=r.charAt(s);s+=1;return i}function g(a){a=new SyntaxError(a);a.pd=s;a.text=r;throw a;}var s,i,e={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},r,o;o=function(){b();switch(i){case "{":var e;a:{var s,k={};if("{"===i){h("{");b();if("}"===i){h("}");e=k;break a}for(;i;){s=d();b();h(":");Object.hasOwnProperty.call(k,s)&&g('Duplicate key "'+s+'"');k[s]=o();b();if("}"===i){h("}");e=k;break a}h(",");b()}}g("Bad object")}return e;case "[":a:{e= [];if("["===i){h("[");b();if("]"===i){h("]");s=e;break a}for(;i;){e.push(o());b();if("]"===i){h("]");s=e;break a}h(",");b()}}g("Bad array")}return s;case '"':return d();case "-":return c();default:return"0"<=i&&"9">=i?c():a()}};return function(a){r=a;s=0;i=" ";a=o();b();i&&g("Syntax error");return a}}();c.nc=function(a){var b,d,f,h,g=0,e=0,i="",i=[];if(!a)return a;a=c.nd(a);do b=a.charCodeAt(g++),d=a.charCodeAt(g++),f=a.charCodeAt(g++),h=b<<16|d<<8|f,b=h>>18&63,d=h>>12&63,f=h>>6&63,h&=63,i[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h);while(ge?c++:i=127e?String.fromCharCode(e>>6|192,e&63|128):String.fromCharCode(e>>12|224,e>>6&63|128,e&63|128);i!==q&&(c>d&&(b+=a.substring(d,c)),b+=i,d=c=g+1)}c>d&&(b+=a.substring(d,a.length));return b};c.Za=function(){function a(){function a(b,d){var c,f=0;for(c=0;cv?(Qa.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+k+"]"),j.removeItem(u),j.removeItem(p),h()):setTimeout(function(){try{a()}catch(c){b&&b(c)}},w*(Math.random()+0.1))}!c&&"function"!==typeof b&&(c=b,b=q);var k=c||(new Date).getTime()+"|"+Math.random(),r=(new Date).getTime(),o=this.K,w= this.Gb,v=this.Vb,j=this.i,n=o+":X",p=o+":Y",u=o+":Z";try{if(U(j,m))h();else throw Error("localStorage support check failed");}catch(t){b&&b(t)}};var pa=ga("batch");G.prototype.Ja=function(a,b,d){var f={id:ea(),flushAfter:(new Date).getTime()+2*b,payload:a};this.Ra.Ya(c.bind(function(){var b;try{var c=this.X();c.push(f);(b=this.Ua(c))&&this.G.push(f)}catch(e){this.h("Error enqueueing item",a),b=D}d&&d(b)},this),c.bind(function(a){this.h("Error acquiring storage lock",a);d&&d(D)},this),this.pa)};G.prototype.tc= function(a){var b=this.G.slice(0,a);if(b.lengthg.flushAfter&&!f[g.id]&&(g.Hc=m,b.push(g),b.length>=a))break}}}return b};G.prototype.Kc=function(a,b){var d={};c.a(a,function(a){d[a]=m});this.G=oa(this.G,d);var f=c.bind(function(){var b;try{var c=this.X(),c=oa(c,d);if(b=this.Ua(c))for(var c=this.X(),f=0;fe.length)this.Y();else{this.Kb=m;var i=c.bind(function(e){this.Kb= D;try{var g=D;if(a.$b)this.W.ld(s);else if(c.e(e)&&"timeout"===e.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.e(e)&&e.N&&(500<=e.N.status||429===e.N.status||"timeout"===e.error)){var i=2*this.la,k=e.N.responseHeaders;if(k){var j=k["Retry-After"];j&&(i=1E3*parseInt(j,10)||i)}i=Math.min(6E5,i);this.h("Error; retry in "+i+" ms");this.Mb(i)}else if(c.e(e)&&e.N&&413===e.N.status)if(1=v.timeout?"timeout":"Bad HTTP status: "+v.status+" "+v.statusText,n.l(a),e&&(k?e({status:0,error:a,N:v}):e(0))};v.send(j)}catch(y){n.l(y),h=D}else j=u.createElement("script"),j.type="text/javascript",j.async=m,j.defer=m,j.src=a,t=u.getElementsByTagName("script")[0],t.parentNode.insertBefore(j,t);return h};e.prototype.wa=function(a){function b(a,b){c.a(a,function(a){if(c.isArray(a[0])){var d=b;c.a(a,function(a){d=d[a[0]].apply(d,a.slice(1))})}else this[a[0]].apply(this,a.slice(1))}, b)}var d,e=[],h=[],g=[];c.a(a,function(a){a&&(d=a[0],c.isArray(d)?g.push(a):"function"===typeof a?a.call(this):c.isArray(a)&&"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]?g.push(a):h.push(a))},this);b(e,this);b(h,this);b(g,this)};e.prototype.hb=function(){return!!this.p.ka};e.prototype.Ac=function(){var a=this.c("token");if(!this.hb()){var b=c.bind(function(b){return new C("__mpq_"+a+b.Ta,{A:this.config,Rc:c.bind(function(a,c,e){this.k(this.c("api_host")+ b.D,this.ab(a),c,this.cb(e,a))},this),fa:c.bind(function(a){return this.fb("before_send_"+b.type,a)},this),I:this.c("error_reporter"),ad:c.bind(this.Ub,this)})},this);this.p={ka:b({type:"events",D:"/track/",Ta:"_ev"}),Ic:b({type:"people",D:"/engage/",Ta:"_pp"}),yc:b({type:"groups",D:"/groups/",Ta:"_gr"})}}this.c("batch_autostart")&&this.Tb()};e.prototype.Tb=function(){if(this.hb())this.P=m,c.a(this.p,function(a){a.start()})};e.prototype.Ub=function(){this.P=D;c.a(this.p,function(a){a.stop();a.clear()})}; e.prototype.push=function(a){this.wa([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.Q.qc=m:this.ta=this.ta.concat(a)};e.prototype.ab=function(a){a=c.ba(a);"base64"===this.c("api_payload_format")&&(a=c.nc(a));return{data:a}};e.prototype.Ca=function(a,b){var d=c.truncate(a.data,255),e=a.D,h=a.Ea,g=a.Zc,j=a.Sc||{},b=b||P,i=m,k=c.bind(function(){j.Sb||(d=this.fb("before_send_"+a.type,d));return d?(p.log("MIXPANEL REQUEST:"),p.log(d),this.k(e,this.ab(d),j,this.cb(b,d))):q},this);this.P&& !g?h.Ja(d,function(a){a?b(1,d):k()}):i=k();return i&&d};e.prototype.o=M(function(a,b,d,e){!e&&"function"===typeof d&&(e=d,d=q);var d=d||{},h=d.transport;if(h)d.Wa=h;h=d.send_immediately;"function"!==typeof e&&(e=P);if(c.g(a))this.l("No event name provided to mixpanel.track");else if(this.bb(a))e(0);else{b=b||{};b.token=this.c("token");var g=this.persistence.Lc(a);c.g(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.gb();g=this.c("track_marketing")?c.info.Ec():{};b=c.extend({}, c.info.V(),g,this.persistence.V(),this.M,b);g=this.c("property_blacklist");c.isArray(g)?c.a(g,function(a){delete b[a]}):this.l("Invalid value for property_blacklist config: "+g);return this.Ca({type:"events",data:{event:a,properties:b},D:this.c("api_host")+"/track/",Ea:this.p.ka,Zc:h,Sc:d},e)}});e.prototype.Xc=M(function(a,b,d){c.isArray(b)||(b=[b]);var e={};e[a]=b;this.m(e);return this.people.set(a,b,d)});e.prototype.kc=M(function(a,b,c){var e=this.s(a);if(e===l){var h={};h[a]=[b];this.m(h)}else-1=== e.indexOf(b)&&(e.push(b),this.m(h));return this.people.$(a,b,c)});e.prototype.Mc=M(function(a,b,c){var e=this.s(a);if(e!==l){var h=e.indexOf(b);-1(y.__SV||0)?p.H("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(y._i,function(a){a&&c.isArray(a)&&(F[a[a.length-1]]=S.apply(this,a))}),Ba(),y.init(),c.a(F,function(a){a.ea()}),Aa())})()})(); })();